package Project;

public class SingleTask {
	private int taskId;
	private int readyTime;
	private int compTime;
	private int deadline;
	private Resource resourceOne;
	private Resource resourceTwo;
	public SingleTask( int TaskId, int ReadyTime, int CompTime, int Deadline, Resource r, Resource r2 )
	{
		taskId = TaskId;
		readyTime = ReadyTime;
		compTime = CompTime;
		deadline = Deadline;
		resourceOne = r;
		resourceTwo = r2;
	}
	public SingleTask()
	{
		taskId = -1;
	}
	public int getTaskId()
	{
		return taskId;
	}
	public int getReadyTime()
	{
		return readyTime;
	}
	public int getCompTime()
	{
		return compTime;
	}
	public int getDeadline()
	{
		return deadline;
	}
	public Resource getResource()
	{
		return resourceOne;
	}
	public void printResourceOne()
	{
		if( resourceOne == Resource.EXCLUSIVE )
			System.out.println("EXCLUSIVE");
		else if( resourceOne == Resource.NO )
			System.out.println("NO");
		else if( resourceOne == Resource.SHARE )
			System.out.println("SHARE");
	}
	public void printResourceaTwo()
	{
		if( resourceTwo == Resource.EXCLUSIVE )
			System.out.println("EXCLUSIVE");
		else if( resourceTwo == Resource.NO )
			System.out.println("NO");
		else if( resourceTwo == Resource.SHARE )
			System.out.println("SHARE");
	}
	
	public Resource getResourceTwo()
	{
		return resourceTwo;
	}
}
